﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SuperSight.Std.UTIL;
using Logs;

namespace Communication.Serial {
    /// <summary>
    /// 串口数据处理
    /// </summary>
    public class SerialProData {
        /// <summary>
        /// 处理接收数据
        /// </summary>
        /// <param name="portName">源端口号</param>
        /// <param name="msg">接收数据</param>
        /// <param name="count">数据长度</param>
        public void ProRecevice(string portName,byte[] msg,int count) {
            Log.Debug(string.Format("来自端口{0}，接收到{1}个数据：{2}",portName,count,Encoding.ASCII.GetString(msg)));
        }

        /// <summary>
        /// 处理预发送数据
        /// </summary>
        /// <returns>预发送数据</returns>
        public byte[] ProSend() {
            byte[] sendbuff = new byte[] { 1,2,3,4,5,6 };

            return sendbuff;
        }
    }
}
